
#define DISC_COUNT 1666  /* All fundamental (negatuve) D with
			|D| <= 20000, h(D) <= 20. */

/* Next, list of fundamental discriminants |D| <= 20000, h(D) <= 20. */
int disc[DISC_COUNT] =  {-3, -4, -7, -8, -11, -19, -43, -67, -163, -15, -20, -24, -35, -40, -51, -52, 
 
  -88, -91, -115, -123, -148, -187, -232, -235, -267, -403, -427, -23, -31, -59, 
 
  -83, -107, -139, -211, -283, -307, -331, -379, -499, -547, -643, -883, -907, 
 
  -39, -55, -56, -68, -84, -120, -132, -136, -155, -168, -184, -195, -203, -219, 
 
  -228, -259, -280, -291, -292, -312, -323, -328, -340, -355, -372, -388, -408, 
 
  -435, -483, -520, -532, -555, -568, -595, -627, -667, -708, -715, -723, -760, 
 
  -763, -772, -795, -955, -1003, -1012, -1027, -1227, -1243, -1387, -1411, 
 
  -1435, -1507, -1555, -47, -79, -103, -127, -131, -179, -227, -347, -443, -523, 
 
  -571, -619, -683, -691, -739, -787, -947, -1051, -1123, -1723, -1747, -1867, 
 
  -2203, -2347, -2683, -87, -104, -116, -152, -212, -244, -247, -339, -411, 
 
  -424, -436, -451, -472, -515, -628, -707, -771, -808, -835, -843, -856, -1048, 
 
  -1059, -1099, -1108, -1147, -1192, -1203, -1219, -1267, -1315, -1347, -1363, 
 
  -1432, -1563, -1588, -1603, -1843, -1915, -1963, -2227, -2283, -2443, -2515, 
 
  -2563, -2787, -2923, -3235, -3427, -3523, -3763, -71, -151, -223, -251, -463, 
 
  -467, -487, -587, -811, -827, -859, -1163, -1171, -1483, -1523, -1627, -1787, 
 
  -1987, -2011, -2083, -2179, -2251, -2467, -2707, -3019, -3067, -3187, -3907, 
 
  -4603, -5107, -5923, -95, -111, -164, -183, -248, -260, -264, -276, -295, 
 
  -299, -308, -371, -376, -395, -420, -452, -456, -548, -552, -564, -579, -580, 
 
  -583, -616, -632, -651, -660, -712, -820, -840, -852, -868, -904, -915, -939, 
 
  -952, -979, -987, -995, -1032, -1043, -1060, -1092, -1128, -1131, -1155, 
 
  -1195, -1204, -1240, -1252, -1288, -1299, -1320, -1339, -1348, -1380, -1428, 
 
  -1443, -1528, -1540, -1635, -1651, -1659, -1672, -1731, -1752, -1768, -1771, 
 
  -1780, -1795, -1803, -1828, -1848, -1864, -1912, -1939, -1947, -1992, -1995, 
 
  -2020, -2035, -2059, -2067, -2139, -2163, -2212, -2248, -2307, -2308, -2323, 
 
  -2392, -2395, -2419, -2451, -2587, -2611, -2632, -2667, -2715, -2755, -2788, 
 
  -2827, -2947, -2968, -2995, -3003, -3172, -3243, -3315, -3355, -3403, -3448, 
 
  -3507, -3595, -3787, -3883, -3963, -4123, -4195, -4267, -4323, -4387, -4747, 
 
  -4843, -4867, -5083, -5467, -5587, -5707, -5947, -6307, -199, -367, -419, 
 
  -491, -563, -823, -1087, -1187, -1291, -1423, -1579, -2003, -2803, -3163, 
 
  -3259, -3307, -3547, -3643, -4027, -4243, -4363, -4483, -4723, -4987, -5443, 
 
  -6043, -6427, -6763, -6883, -7723, -8563, -8803, -9067, -10627, -119, -143, 
 
  -159, -296, -303, -319, -344, -415, -488, -611, -635, -664, -699, -724, -779, 
 
  -788, -803, -851, -872, -916, -923, -1115, -1268, -1384, -1492, -1576, -1643, 
 
  -1684, -1688, -1707, -1779, -1819, -1835, -1891, -1923, -2152, -2164, -2363, 
 
  -2452, -2643, -2776, -2836, -2899, -3028, -3091, -3139, -3147, -3291, -3412, 
 
  -3508, -3635, -3667, -3683, -3811, -3859, -3928, -4083, -4227, -4372, -4435, 
 
  -4579, -4627, -4852, -4915, -5131, -5163, -5272, -5515, -5611, -5667, -5803, 
 
  -6115, -6259, -6403, -6667, -7123, -7363, -7387, -7435, -7483, -7627, -8227, 
 
  -8947, -9307, -10147, -10483, -13843, -167, -271, -659, -967, -1283, -1303, 
 
  -1307, -1459, -1531, -1699, -2027, -2267, -2539, -2731, -2851, -2971, -3203, 
 
  -3347, -3499, -3739, -3931, -4051, -5179, -5683, -6163, -6547, -7027, -7507, 
 
  -7603, -7867, -8443, -9283, -9403, -9643, -9787, -10987, -13003, -13267, 
 
  -14107, -14683, -15667, -231, -255, -327, -356, -440, -516, -543, -655, -680, 
 
  -687, -696, -728, -731, -744, -755, -804, -888, -932, -948, -964, -984, -996, 
 
  -1011, -1067, -1096, -1144, -1208, -1235, -1236, -1255, -1272, -1336, -1355, 
 
  -1371, -1419, -1464, -1480, -1491, -1515, -1547, -1572, -1668, -1720, -1732, 
 
  -1763, -1807, -1812, -1892, -1955, -1972, -2068, -2091, -2104, -2132, -2148, 
 
  -2155, -2235, -2260, -2355, -2387, -2388, -2424, -2440, -2468, -2472, -2488, 
 
  -2491, -2555, -2595, -2627, -2635, -2676, -2680, -2692, -2723, -2728, -2740, 
 
  -2795, -2867, -2872, -2920, -2955, -3012, -3027, -3043, -3048, -3115, -3208, 
 
  -3252, -3256, -3268, -3304, -3387, -3451, -3459, -3592, -3619, -3652, -3723, 
 
  -3747, -3768, -3796, -3835, -3880, -3892, -3955, -3972, -4035, -4120, -4132, 
 
  -4147, -4152, -4155, -4168, -4291, -4360, -4411, -4467, -4531, -4552, -4555, 
 
  -4587, -4648, -4699, -4708, -4755, -4771, -4792, -4795, -4827, -4888, -4907, 
 
  -4947, -4963, -5032, -5035, -5128, -5140, -5155, -5188, -5259, -5299, -5307, 
 
  -5371, -5395, -5523, -5595, -5755, -5763, -5811, -5835, -6187, -6232, -6235, 
 
  -6267, -6283, -6472, -6483, -6603, -6643, -6715, -6787, -6843, -6931, -6955, 
 
  -6963, -6987, -7107, -7291, -7492, -7555, -7683, -7891, -7912, -8068, -8131, 
 
  -8155, -8248, -8323, -8347, -8395, -8787, -8827, -9003, -9139, -9355, -9523, 
 
  -9667, -9843, -10003, -10603, -10707, -10747, -10795, -10915, -11155, -11347, 
 
  -11707, -11803, -12307, -12643, -14443, -15163, -15283, -16003, -17803, -191, 
 
  -263, -607, -631, -727, -1019, -1451, -1499, -1667, -1907, -2131, -2143, 
 
  -2371, -2659, -2963, -3083, -3691, -4003, -4507, -4643, -5347, -5419, -5779, 
 
  -6619, -7243, -7963, -9547, -9739, -11467, -11587, -11827, -11923, -12043, 
 
  -14347, -15787, -16963, -215, -287, -391, -404, -447, -511, -535, -536, -596, 
 
  -692, -703, -807, -899, -1112, -1211, -1396, -1403, -1527, -1816, -1851, 
 
  -1883, -2008, -2123, -2147, -2171, -2335, -2427, -2507, -2536, -2571, -2612, 
 
  -2779, -2931, -2932, -3112, -3227, -3352, -3579, -3707, -3715, -3867, -3988, 
 
  -4187, -4315, -4443, -4468, -4659, -4803, -4948, -5027, -5091, -5251, -5267, 
 
  -5608, -5723, -5812, -5971, -6388, -6499, -6523, -6568, -6979, -7067, -7099, 
 
  -7147, -7915, -8035, -8187, -8611, -8899, -9115, -9172, -9235, -9427, -10123, 
 
  -10315, -10363, -10411, -11227, -12147, -12667, -12787, -13027, -13435, 
 
  -13483, -13603, -14203, -16867, -18187, -18547, -18643, -239, -439, -751, 
 
  -971, -1259, -1327, -1427, -1567, -1619, -2243, -2647, -2699, -2843, -3331, 
 
  -3571, -3803, -4099, -4219, -5003, -5227, -5323, -5563, -5827, -5987, -6067, 
 
  -6091, -6211, -6571, -7219, -7459, -7547, -8467, -8707, -8779, -9043, -9907, 
 
  -10243, -10267, -10459, -10651, -10723, -11083, -11971, -12163, -12763, 
 
  -13147, -13963, -14323, -14827, -14851, -15187, -15643, -15907, -16603, 
 
  -16843, -17467, -17923, -18043, -18523, -19387, -19867, -399, -407, -471, 
 
  -559, -584, -644, -663, -740, -799, -884, -895, -903, -943, -1015, -1016, 
 
  -1023, -1028, -1047, -1139, -1140, -1159, -1220, -1379, -1412, -1416, -1508, 
 
  -1560, -1595, -1608, -1624, -1636, -1640, -1716, -1860, -1876, -1924, -1983, 
 
  -2004, -2019, -2040, -2056, -2072, -2095, -2195, -2211, -2244, -2280, -2292, 
 
  -2296, -2328, -2356, -2379, -2436, -2568, -2580, -2584, -2739, -2760, -2811, 
 
  -2868, -2884, -2980, -3063, -3108, -3140, -3144, -3160, -3171, -3192, -3220, 
 
  -3336, -3363, -3379, -3432, -3435, -3443, -3460, -3480, -3531, -3556, -3588, 
 
  -3603, -3640, -3732, -3752, -3784, -3795, -3819, -3828, -3832, -3939, -3976, 
 
  -4008, -4020, -4043, -4171, -4179, -4180, -4216, -4228, -4251, -4260, -4324, 
 
  -4379, -4420, -4427, -4440, -4452, -4488, -4515, -4516, -4596, -4612, -4683, 
 
  -4687, -4712, -4740, -4804, -4899, -4939, -4971, -4984, -5115, -5160, -5187, 
 
  -5195, -5208, -5363, -5380, -5403, -5412, -5428, -5460, -5572, -5668, -5752, 
 
  -5848, -5860, -5883, -5896, -5907, -5908, -5992, -5995, -6040, -6052, -6099, 
 
  -6123, -6148, -6195, -6312, -6315, -6328, -6355, -6395, -6420, -6532, -6580, 
 
  -6595, -6612, -6628, -6708, -6747, -6771, -6792, -6820, -6868, -6923, -6952, 
 
  -7003, -7035, -7051, -7195, -7288, -7315, -7347, -7368, -7395, -7480, -7491, 
 
  -7540, -7579, -7588, -7672, -7707, -7747, -7755, -7780, -7795, -7819, -7828, 
 
  -7843, -7923, -7995, -8008, -8043, -8052, -8083, -8283, -8299, -8308, -8452, 
 
  -8515, -8547, -8548, -8635, -8643, -8680, -8683, -8715, -8835, -8859, -8932, 
 
  -8968, -9208, -9219, -9412, -9483, -9507, -9508, -9595, -9640, -9763, -9835, 
 
  -9867, -9955, -10132, -10168, -10195, -10203, -10227, -10312, -10387, -10420, 
 
  -10563, -10587, -10635, -10803, -10843, -10948, -10963, -11067, -11092, 
 
  -11107, -11179, -11203, -11512, -11523, -11563, -11572, -11635, -11715, 
 
  -11848, -11995, -12027, -12259, -12387, -12523, -12595, -12747, -12772, 
 
  -12835, -12859, -12868, -13123, -13192, -13195, -13288, -13323, -13363, 
 
  -13507, -13795, -13819, -13827, -14008, -14155, -14371, -14403, -14547, 
 
  -14707, -14763, -14995, -15067, -15387, -15403, -15547, -15715, -16027, 
 
  -16195, -16347, -16531, -16555, -16723, -17227, -17323, -17347, -17427, 
 
  -17515, -18403, -18715, -18883, -18907, -19147, -19195, -19947, -19987, -383, 
 
  -991, -1091, -1571, -1663, -1783, -2531, -3323, -3947, -4339, -4447, -4547, 
 
  -4651, -5483, -6203, -6379, -6451, -6827, -6907, -7883, -8539, -8731, -9883, 
 
  -11251, -11443, -12907, -13627, -14083, -14779, -14947, -16699, -17827, 
 
  -18307, -19963, -335, -519, -527, -679, -1135, -1172, -1207, -1383, -1448, 
 
  -1687, -1691, -1927, -2047, -2051, -2167, -2228, -2291, -2315, -2344, -2644, 
 
  -2747, -2859, -3035, -3107, -3543, -3544, -3651, -3688, -4072, -4299, -4307, 
 
  -4568, -4819, -4883, -5224, -5315, -5464, -5492, -5539, -5899, -6196, -6227, 
 
  -6331, -6387, -6484, -6739, -6835, -7323, -7339, -7528, -7571, -7715, -7732, 
 
  -7771, -7827, -8152, -8203, -8212, -8331, -8403, -8488, -8507, -8587, -8884, 
 
  -9123, -9211, -9563, -9627, -9683, -9748, -9832, -10228, -10264, -10347, 
 
  -10523, -11188, -11419, -11608, -11643, -11683, -11851, -11992, -12067, 
 
  -12148, -12187, -12235, -12283, -12651, -12723, -12811, -12952, -13227, 
 
  -13315, -13387, -13747, -13947, -13987, -14163, -14227, -14515, -14667, 
 
  -14932, -15115, -15243, -16123, -16171, -16387, -16627, -17035, -17131, 
 
  -17403, -17635, -18283, -18712, -19027, -19123, -19651, -311, -359, -919, 
 
  -1063, -1543, -1831, -2099, -2339, -2459, -3343, -3463, -3467, -3607, -4019, 
 
  -4139, -4327, -5059, -5147, -5527, -5659, -6803, -8419, -8923, -8971, -9619, 
 
  -10891, -11299, -15091, -15331, -16363, -16747, -17011, -17299, -17539, 
 
  -17683, -19507, -455, -615, -776, -824, -836, -920, -1064, -1124, -1160, 
 
  -1263, -1284, -1460, -1495, -1524, -1544, -1592, -1604, -1652, -1695, -1739, 
 
  -1748, -1796, -1880, -1887, -1896, -1928, -1940, -1956, -2136, -2247, -2360, 
 
  -2404, -2407, -2483, -2487, -2532, -2552, -2596, -2603, -2712, -2724, -2743, 
 
  -2948, -2983, -2987, -3007, -3016, -3076, -3099, -3103, -3124, -3131, -3155, 
 
  -3219, -3288, -3320, -3367, -3395, -3496, -3512, -3515, -3567, -3655, -3668, 
 
  -3684, -3748, -3755, -3908, -3979, -4011, -4015, -4024, -4036, -4148, -4264, 
 
  -4355, -4371, -4395, -4403, -4408, -4539, -4548, -4660, -4728, -4731, -4756, 
 
  -4763, -4855, -4891, -5019, -5028, -5044, -5080, -5092, -5268, -5331, -5332, 
 
  -5352, -5368, -5512, -5560, -5592, -5731, -5944, -5955, -5956, -5988, -6051, 
 
  -6088, -6136, -6139, -6168, -6280, -6339, -6467, -6504, -6648, -6712, -6755, 
 
  -6808, -6856, -7012, -7032, -7044, -7060, -7096, -7131, -7144, -7163, -7171, 
 
  -7192, -7240, -7428, -7432, -7467, -7572, -7611, -7624, -7635, -7651, -7667, 
 
  -7720, -7851, -7876, -7924, -7939, -8067, -8251, -8292, -8296, -8355, -8404, 
 
  -8472, -8491, -8632, -8692, -8755, -8808, -8920, -8995, -9051, -9124, -9147, 
 
  -9160, -9195, -9331, -9339, -9363, -9443, -9571, -9592, -9688, -9691, -9732, 
 
  -9755, -9795, -9892, -9976, -9979, -10027, -10083, -10155, -10171, -10291, 
 
  -10299, -10308, -10507, -10515, -10552, -10564, -10819, -10888, -11272, 
 
  -11320, -11355, -11379, -11395, -11427, -11428, -11539, -11659, -11755, 
 
  -11860, -11883, -11947, -11955, -12019, -12139, -12280, -12315, -12328, 
 
  -12331, -12355, -12363, -12467, -12468, -12472, -12499, -12532, -12587, 
 
  -12603, -12712, -12883, -12931, -12955, -12963, -13155, -13243, -13528, 
 
  -13555, -13588, -13651, -13803, -13960, -14307, -14331, -14467, -14491, 
 
  -14659, -14755, -14788, -15235, -15268, -15355, -15603, -15688, -15691, 
 
  -15763, -15883, -15892, -15955, -16147, -16228, -16395, -16408, -16435, 
 
  -16483, -16507, -16612, -16648, -16683, -16707, -16915, -16923, -17067, 
 
  -17187, -17368, -17563, -17643, -17763, -17907, -18067, -18163, -18195, 
 
  -18232, -18355, -18363, -19083, -19443, -19492, -19555, -19923};
